/*   1:    */ package gov.sat.tax.fwsk.wlrz;
/*   2:    */ 
/*   3:    */ import java.io.PrintStream;
/*   4:    */ import java.util.StringTokenizer;
/*   5:    */ 
/*   6:    */ public class TransRzParaBean
/*   7:    */ {
/*   8: 20 */   private String Cryptext = "";
/*   9:    */   private byte[] byteData;
/*  10: 23 */   private String strRZData = null;
/*  11:    */   private int[] nsrsbh_offset;
/*  12:    */   private int[] gfsbh_offset;
/*  13:    */   private int[] xfsbh_offset;
/*  14:    */   private int[] fp_dm_offset;
/*  15:    */   private int[] fp_hm_offset;
/*  16:    */   private int[] kprq_offset;
/*  17:    */   private int[] kpyear_offset;
/*  18:    */   private int[] kpmonth_offset;
/*  19:    */   private int[] kpday_offset;
/*  20:    */   private int[] je_offset;
/*  21:    */   private int[] se_offset;
/*  22:    */   private int[] mw1_offset;
/*  23:    */   private int[] mw2_offset;
/*  24:    */   private int[] mw3_offset;
/*  25:    */   private int[] mw4_offset;
/*  26:    */   private int[] sym_offset;
/*  27:    */   private int[] jmbb_offset;
/*  28:    */   private int[] gd_offset;
/*  29: 44 */   public boolean newVer = false;
/*  30:    */   
/*  31:    */   public byte[] doDecrypt(String Cryptograph)
/*  32:    */   {
/*  33: 47 */     CryptographerBean Rdec = new CryptographerBean();
/*  34: 48 */     this.byteData = Rdec.RealTmDecrypt(Cryptograph);
/*  35: 49 */     this.strRZData = new String(this.byteData);
/*  36:    */     
/*  37:    */ 
/*  38: 52 */     return this.byteData;
/*  39:    */   }
/*  40:    */   
/*  41:    */   public TransRzParaBean(int log)
/*  42:    */   {
/*  43: 57 */     this.nsrsbh_offset = new int[] { 0, 20 };
/*  44: 58 */     this.gfsbh_offset = new int[] { 20, 40 };
/*  45: 59 */     this.xfsbh_offset = new int[] { 40, 60 };
/*  46: 60 */     this.fp_dm_offset = new int[] { 60, 70 };
/*  47: 61 */     this.fp_hm_offset = new int[] { 70, 78 };
/*  48: 62 */     this.kprq_offset = new int[] { 78, 86 };
/*  49: 63 */     this.kpyear_offset = new int[] { 78, 82 };
/*  50: 64 */     this.kpmonth_offset = new int[] { 82, 84 };
/*  51: 65 */     this.kpday_offset = new int[] { 84, 86 };
/*  52: 66 */     this.je_offset = new int[] { 86, 105 };
/*  53: 67 */     this.se_offset = new int[] { 105, 124 };
/*  54: 68 */     this.mw1_offset = new int[] { 124, 151 };
/*  55: 69 */     this.mw2_offset = new int[] { 151, 178 };
/*  56: 70 */     this.mw3_offset = new int[] { 178, 205 };
/*  57: 71 */     this.mw4_offset = new int[] { 205, 232 };
/*  58: 72 */     this.sym_offset = new int[] { 232, 248 };
/*  59: 73 */     this.jmbb_offset = new int[] { 248, 250 };
/*  60: 74 */     this.gd_offset = new int[] { 250, 252 };
/*  61:    */   }
/*  62:    */   
/*  63:    */   public TransRzParaBean()
/*  64:    */   {
/*  65: 79 */     this.nsrsbh_offset = new int[] { 0, 20 };
/*  66: 80 */     this.gfsbh_offset = new int[] { 20, 40 };
/*  67: 81 */     this.xfsbh_offset = new int[] { 40, 60 };
/*  68: 82 */     this.fp_dm_offset = new int[] { 60, 70 };
/*  69: 83 */     this.fp_hm_offset = new int[] { 70, 78 };
/*  70: 84 */     this.kprq_offset = new int[] { 78, 86 };
/*  71: 85 */     this.kpyear_offset = new int[] { 78, 82 };
/*  72: 86 */     this.kpmonth_offset = new int[] { 82, 84 };
/*  73: 87 */     this.kpday_offset = new int[] { 84, 86 };
/*  74: 88 */     this.je_offset = new int[] { 86, 105 };
/*  75: 89 */     this.se_offset = new int[] { 105, 124 };
/*  76: 90 */     this.mw1_offset = new int[] { 124, 145 };
/*  77: 91 */     this.mw2_offset = new int[] { 145, 166 };
/*  78: 92 */     this.mw3_offset = new int[] { 166, 187 };
/*  79: 93 */     this.mw4_offset = new int[] { 187, 208 };
/*  80: 94 */     this.sym_offset = new int[] { 208, 224 };
/*  81: 95 */     this.jmbb_offset = new int[] { 224, 226 };
/*  82: 96 */     this.gd_offset = new int[] { 226, 228 };
/*  83:    */   }
/*  84:    */   
/*  85:    */   public TransRzParaBean(String p)
/*  86:    */   {
/*  87:104 */     this.newVer = true;
/*  88:    */   }
/*  89:    */   
/*  90:    */   public String getParameter(String pvalue)
/*  91:    */   {
/*  92:109 */     if (this.newVer) {
/*  93:110 */       return getNewParameter(pvalue);
/*  94:    */     }
/*  95:114 */     String stemp = null;
/*  96:    */     
/*  97:116 */     String str_XmlData = null;
/*  98:117 */     String str_Mw = null;
/*  99:118 */     if (pvalue.equals("nsrsbh"))
/* 100:    */     {
/* 101:120 */       stemp = this.strRZData.substring(this.nsrsbh_offset[0], this.nsrsbh_offset[1]).trim();
/* 102:121 */       return Integer.parseInt(stemp.substring(0, 6)) + stemp.substring(6);
/* 103:    */     }
/* 104:124 */     if (pvalue.equals("QYMC"))
/* 105:    */     {
/* 106:125 */       stemp = this.strRZData.substring(this.nsrsbh_offset[0], this.nsrsbh_offset[1]).trim();
/* 107:126 */       return Integer.parseInt(stemp.substring(0, 6)) + stemp.substring(6);
/* 108:    */     }
/* 109:128 */     if (pvalue.equals("fpdm")) {
/* 110:129 */       return this.strRZData.substring(this.fp_dm_offset[0], this.fp_dm_offset[1]);
/* 111:    */     }
/* 112:130 */     if (pvalue.equals("fphm")) {
/* 113:131 */       return this.strRZData.substring(this.fp_hm_offset[0], this.fp_hm_offset[1]);
/* 114:    */     }
/* 115:132 */     if (pvalue.equals("gsbh"))
/* 116:    */     {
/* 117:133 */       stemp = this.strRZData.substring(this.gfsbh_offset[0], this.gfsbh_offset[1]).trim();
/* 118:134 */       return Integer.parseInt(stemp.substring(0, 6)) + stemp.substring(6);
/* 119:    */     }
/* 120:136 */     if (pvalue.equals("xsbh"))
/* 121:    */     {
/* 122:137 */       stemp = this.strRZData.substring(this.xfsbh_offset[0], this.xfsbh_offset[1]).trim();
/* 123:138 */       return Integer.parseInt(stemp.substring(0, 6)) + stemp.substring(6);
/* 124:    */     }
/* 125:140 */     if (pvalue.equals("kprq")) {
/* 126:141 */       return String.valueOf(Long.valueOf(this.strRZData.substring(this.kprq_offset[0], this.kprq_offset[1])).longValue()).toString();
/* 127:    */     }
/* 128:143 */     if (pvalue.equals("kpyear")) {
/* 129:144 */       return this.strRZData.substring(this.kpyear_offset[0], this.kpyear_offset[1]);
/* 130:    */     }
/* 131:146 */     if (pvalue.equals("kpmonth")) {
/* 132:147 */       return this.strRZData.substring(this.kpmonth_offset[0], this.kpmonth_offset[1]);
/* 133:    */     }
/* 134:149 */     if (pvalue.equals("kpday")) {
/* 135:150 */       return this.strRZData.substring(this.kpday_offset[0], this.kpday_offset[1]);
/* 136:    */     }
/* 137:152 */     if (pvalue.equals("jine"))
/* 138:    */     {
/* 139:154 */       stemp = this.strRZData.substring(this.je_offset[0], this.je_offset[1]).trim();
/* 140:155 */       int itemp = stemp.indexOf("-");
/* 141:156 */       if (itemp == -1) {
/* 142:158 */         itemp = 0;
/* 143:    */       }
/* 144:160 */       return String.valueOf(Double.valueOf(stemp.substring(itemp)).doubleValue()).toString();
/* 145:    */     }
/* 146:163 */     if (pvalue.equals("shuie"))
/* 147:    */     {
/* 148:165 */       stemp = this.strRZData.substring(this.se_offset[0], this.se_offset[1]).trim();
/* 149:166 */       int itemp = stemp.indexOf("-");
/* 150:167 */       if (itemp == -1) {
/* 151:168 */         itemp = 0;
/* 152:    */       }
/* 153:170 */       return String.valueOf(Double.valueOf(stemp.substring(itemp)).doubleValue()).toString();
/* 154:    */     }
/* 155:172 */     if (pvalue.equals("miwen1")) {
/* 156:173 */       return this.strRZData.substring(this.mw1_offset[0], this.mw1_offset[1]);
/* 157:    */     }
/* 158:175 */     if (pvalue.equals("miwen2")) {
/* 159:176 */       return this.strRZData.substring(this.mw2_offset[0], this.mw2_offset[1]);
/* 160:    */     }
/* 161:178 */     if (pvalue.equals("miwen3")) {
/* 162:179 */       return this.strRZData.substring(this.mw3_offset[0], this.mw3_offset[1]);
/* 163:    */     }
/* 164:181 */     if (pvalue.equals("miwen4")) {
/* 165:182 */       return this.strRZData.substring(this.mw4_offset[0], this.mw4_offset[1]);
/* 166:    */     }
/* 167:185 */     if (pvalue.equals("gdzc"))
/* 168:    */     {
/* 169:187 */       String gd = this.strRZData.substring(this.gd_offset[0], this.gd_offset[1]);
/* 170:189 */       if (gd.equals("02")) {
/* 171:190 */         return "0";
/* 172:    */       }
/* 173:192 */       return "1";
/* 174:    */     }
/* 175:204 */     if (pvalue.equals("fpid")) {
/* 176:206 */       return this.strRZData.substring(this.sym_offset[0], this.sym_offset[1]);
/* 177:    */     }
/* 178:209 */     str_XmlData = null;
/* 179:210 */     return str_XmlData;
/* 180:    */   }
/* 181:    */   
/* 182:    */   public String getNewParameter(String Para)
/* 183:    */   {
/* 184:225 */     String s = null;String sName = null;String sValue = null;
/* 185:    */     try
/* 186:    */     {
/* 187:229 */       StringTokenizer paramTokens = new StringTokenizer(this.strRZData, "&");
/* 188:231 */       while (paramTokens.hasMoreTokens())
/* 189:    */       {
/* 190:233 */         s = paramTokens.nextToken();
/* 191:234 */         sName = s.substring(0, s.indexOf("="));
/* 192:236 */         if (Para.equalsIgnoreCase(sName))
/* 193:    */         {
/* 194:238 */           sValue = s.substring(s.indexOf("=") + 1, s.length());
/* 195:239 */           if (!Para.equalsIgnoreCase("gdzc")) {
/* 196:    */             break;
/* 197:    */           }
/* 198:240 */           if (sValue.equals("02")) {
/* 199:241 */             return "0";
/* 200:    */           }
/* 201:243 */           return "1";
/* 202:    */         }
/* 203:    */       }
/* 204:    */     }
/* 205:    */     catch (Exception e)
/* 206:    */     {
/* 207:252 */       System.out.println("TransRzParaBean.getNewParameter error: " + 
/* 208:253 */         e.toString());
/* 209:    */       
/* 210:255 */       return null;
/* 211:    */     }
/* 212:258 */     return sValue;
/* 213:    */   }
/* 214:    */ }


/* Location:           D:\htjs\document\wsrz\WsrzEjbInf\
 * Qualified Name:     gov.sat.tax.fwsk.wlrz.TransRzParaBean
 * JD-Core Version:    0.7.0.1
 */